home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 July: Mac OS SDK / Dev.CD Jul 99 SDK1.toast / Development Kits / Mac OS / Interfaces&Libraries / Universal / Interfaces / PInterfaces / Folders.p < prev    next >
Encoding:
Text File  |  1998-08-17  |  11.1 KB  |  274 lines  |  [TEXT/MPS ]

  1. {
  2.      File:        Folders.p
  3.  
  4.      Contains:    Folder Manager Interfaces.
  5.  
  6.      Version:    Technology:    Mac OS 8
  7.                  Release:    Universal Interfaces 3.2
  8.  
  9.      Copyright:    © 1995-1998 by Apple Computer, Inc., all rights reserved.
  10.  
  11.      Bugs?:        For bug reports, consult the following page on
  12.                  the World Wide Web:
  13.  
  14.                      http://developer.apple.com/bugreporter/
  15.  
  16. }
  17. {$IFC UNDEFINED UsingIncludes}
  18. {$SETC UsingIncludes := 0}
  19. {$ENDC}
  20.  
  21. {$IFC NOT UsingIncludes}
  22.  UNIT Folders;
  23.  INTERFACE
  24. {$ENDC}
  25.  
  26. {$IFC UNDEFINED __FOLDERS__}
  27. {$SETC __FOLDERS__ := 1}
  28.  
  29. {$I+}
  30. {$SETC FoldersIncludes := UsingIncludes}
  31. {$SETC UsingIncludes := 1}
  32.  
  33. {$IFC UNDEFINED __MACTYPES__}
  34. {$I MacTypes.p}
  35. {$ENDC}
  36.  
  37.  
  38. {$PUSH}
  39. {$ALIGN MAC68K}
  40. {$LibExport+}
  41.  
  42.  
  43. CONST
  44.     kOnSystemDisk                = -32768;                        {  previously was 0x8000 but that is an unsigned value whereas vRefNum is signed }
  45.  
  46.     kCreateFolder                = true;
  47.     kDontCreateFolder            = false;
  48.  
  49.     kSystemFolderType            = 'macs';                        {  the system folder  }
  50.     kDesktopFolderType            = 'desk';                        {  the desktop folder; objects in this folder show on the desk top.  }
  51.     kTrashFolderType            = 'trsh';                        {  the trash folder; objects in this folder show up in the trash  }
  52.     kWhereToEmptyTrashFolderType = 'empt';                        {  the "empty trash" folder; Finder starts empty from here down  }
  53.     kPrintMonitorDocsFolderType    = 'prnt';                        {  Print Monitor documents  }
  54.     kStartupFolderType            = 'strt';                        {  Finder objects (applications, documents, DAs, aliases, to...) to open at startup go here  }
  55.     kShutdownFolderType            = 'shdf';                        {  Finder objects (applications, documents, DAs, aliases, to...) to open at shutdown go here  }
  56.     kAppleMenuFolderType        = 'amnu';                        {  Finder objects to put into the Apple menu go here  }
  57.     kControlPanelFolderType        = 'ctrl';                        {  Control Panels go here (may contain INITs)  }
  58.     kExtensionFolderType        = 'extn';                        {  System extensions go here  }
  59.     kFontsFolderType            = 'font';                        {  Fonts go here  }
  60.     kPreferencesFolderType        = 'pref';                        {  preferences for applications go here  }
  61.     kTemporaryFolderType        = 'temp';                        {  temporary files go here (deleted periodically, but don't rely on it.)  }
  62.  
  63. {
  64.     Note:     The FindFolder trap was not implemented until System 7.  If you want to call FindFolder
  65.             while running on System 6 machines, then define USE_FINDFOLDER_GLUE and link with
  66.             Interface.o which contains glue to implement FindFolder on pre-System 7 machines.
  67. }
  68. {$IFC NOT UNDEFINED USE_FINDFOLDER_GLUE }
  69. FUNCTION FindFolder(vRefNum: INTEGER; folderType: OSType; createFolder: BOOLEAN; VAR foundVRefNum: INTEGER; VAR foundDirID: LONGINT): OSErr;
  70. {$ELSEC}
  71. FUNCTION FindFolder(vRefNum: INTEGER; folderType: OSType; createFolder: BOOLEAN; VAR foundVRefNum: INTEGER; VAR foundDirID: LONGINT): OSErr;
  72.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  73.     INLINE $7000, $A823;
  74.     {$ENDC}
  75. {$ENDC}
  76.  
  77. FUNCTION ReleaseFolder(vRefNum: INTEGER; folderType: OSType): OSErr;
  78.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  79.     INLINE $700B, $A823;
  80.     {$ENDC}
  81.  
  82. {$IFC NOT TARGET_OS_MAC }
  83. { Since non-mac targets don't know about VRef's or DirID's, the Ex version returns
  84.    the found folder path.
  85.  }
  86. FUNCTION FindFolderEx(vRefNum: INTEGER; folderType: OSType; createFolder: BOOLEAN; VAR foundVRefNum: INTEGER; VAR foundDirID: LONGINT; foundFolder: CStringPtr): OSErr; C;
  87. {$ENDC}
  88.  
  89. {****************************************}
  90. { Extensible Folder Manager declarations }
  91. {****************************************}
  92.  
  93. {**************************}
  94. { Folder Manager constants }
  95. {**************************}
  96.  
  97.  
  98. CONST
  99.     kExtensionDisabledFolderType = 'extD';
  100.     kControlPanelDisabledFolderType = 'ctrD';
  101.     kSystemExtensionDisabledFolderType = 'macD';
  102.     kStartupItemsDisabledFolderType = 'strD';
  103.     kShutdownItemsDisabledFolderType = 'shdD';
  104.     kApplicationsFolderType        = 'apps';
  105.     kDocumentsFolderType        = 'docs';
  106.  
  107.                                                                 {  new constants  }
  108.     kVolumeRootFolderType        = 'root';                        {  root folder of a volume  }
  109.     kChewableItemsFolderType    = 'flnt';                        {  items deleted at boot  }
  110.     kApplicationSupportFolderType = 'asup';                        {  third-party items and folders  }
  111.     kTextEncodingsFolderType    = 'ƒtex';                        {  encoding tables  }
  112.     kStationeryFolderType        = 'odst';                        {  stationery  }
  113.     kOpenDocFolderType            = 'odod';                        {  OpenDoc root  }
  114.     kOpenDocShellPlugInsFolderType = 'odsp';                    {  OpenDoc Shell Plug-Ins in OpenDoc folder  }
  115.     kEditorsFolderType            = 'oded';                        {  OpenDoc editors in MacOS Folder  }
  116.     kOpenDocEditorsFolderType    = 'ƒodf';                        {  OpenDoc subfolder of Editors folder  }
  117.     kOpenDocLibrariesFolderType    = 'odlb';                        {  OpenDoc libraries folder  }
  118.     kGenEditorsFolderType        = 'ƒedi';                        {  CKH general editors folder at root level of Sys folder  }
  119.     kHelpFolderType                = 'ƒhlp';                        {  CKH help folder currently at root of system folder  }
  120.     kInternetPlugInFolderType    = 'ƒnet';                        {  CKH internet plug ins for browsers and stuff  }
  121.     kModemScriptsFolderType        = 'ƒmod';                        {  CKH modem scripts, get 'em OUT of the Extensions folder  }
  122.     kPrinterDescriptionFolderType = 'ppdf';                        {  CKH new folder at root of System folder for printer descs.  }
  123.     kPrinterDriverFolderType    = 'ƒprd';                        {  CKH new folder at root of System folder for printer drivers  }
  124.     kScriptingAdditionsFolderType = 'ƒscr';                        {  CKH at root of system folder  }
  125.     kSharedLibrariesFolderType    = 'ƒlib';                        {  CKH for general shared libs.  }
  126.     kVoicesFolderType            = 'fvoc';                        {  CKH macintalk can live here  }
  127.     kControlStripModulesFolderType = 'sdev';                    {  CKH for control strip modules  }
  128.     kAssistantsFolderType        = 'astƒ';                        {  SJF for Assistants (MacOS Setup Assistant, etc)  }
  129.     kUtilitiesFolderType        = 'utiƒ';                        {  SJF for Utilities folder  }
  130.     kAppleExtrasFolderType        = 'aexƒ';                        {  SJF for Apple Extras folder  }
  131.     kContextualMenuItemsFolderType = 'cmnu';                    {  SJF for Contextual Menu items  }
  132.     kMacOSReadMesFolderType        = 'morƒ';                        {  SJF for MacOS ReadMes folder  }
  133.     kALMModulesFolderType        = 'walk';                        {  EAS for Location Manager Module files except type 'thng' (within kExtensionFolderType)  }
  134.     kALMPreferencesFolderType    = 'trip';                        {  EAS for Location Manager Preferences (within kPreferencesFolderType; contains kALMLocationsFolderType)  }
  135.     kALMLocationsFolderType        = 'fall';                        {  EAS for Location Manager Locations (within kALMPreferencesFolderType)  }
  136.     kColorSyncProfilesFolderType = 'prof';                        {  for ColorSync™ Profiles  }
  137.     kThemesFolderType            = 'thme';                        {  for Theme data files  }
  138.     kFavoritesFolderType        = 'favs';                        {  Favorties folder for Navigation Services  }
  139.     kInternetFolderType            = 'intƒ';                        {  Internet folder (root level of startup volume)  }
  140.     kAppearanceFolderType        = 'appr';                        {  Appearance folder (root of system folder)  }
  141.     kSoundSetsFolderType        = 'snds';                        {  Sound Sets folder (in Appearance folder)  }
  142.     kDesktopPicturesFolderType    = 'dtpƒ';                        {  Desktop Pictures folder (in Appearance folder)  }
  143.     kInternetSearchSitesFolderType = 'issf';                    {  Internet Search Sites folder  }
  144.     kFindSupportFolderType        = 'fnds';                        {  Find support folder  }
  145.     kFindByContentFolderType    = 'fbcf';                        {  Find by content folder  }
  146.     kInstallerLogsFolderType    = 'ilgf';                        {  Installer Logs folder  }
  147.     kScriptsFolderType            = 'scrƒ';                        {  Scripts folder  }
  148.     kFolderActionsFolderType    = 'fasf';                        {  Folder Actions Scripts folder  }
  149.     kLauncherItemsFolderType    = 'laun';                        {  Launcher Items folder  }
  150.     kRecentApplicationsFolderType = 'rapp';                        {  Recent Applications folder  }
  151.     kRecentDocumentsFolderType    = 'rdoc';                        {  Recent Documents folder  }
  152.     kRecentServersFolderType    = 'rsvr';                        {  Recent Servers folder  }
  153.     kSpeakableItemsFolderType    = 'spki';                        {  Speakable Items folder  }
  154.  
  155.  
  156. { FolderDescFlags values }
  157.     kCreateFolderAtBoot            = $00000002;
  158.     kFolderCreatedInvisible        = $00000004;
  159.     kFolderCreatedNameLocked    = $00000008;
  160.  
  161.  
  162. TYPE
  163.     FolderDescFlags                        = UInt32;
  164. { FolderClass values }
  165.  
  166. CONST
  167.     kRelativeFolder                = 'relf';
  168.     kSpecialFolder                = 'spcf';
  169.  
  170.  
  171. TYPE
  172.     FolderClass                            = OSType;
  173. { special folder locations }
  174.  
  175. CONST
  176.     kBlessedFolder                = 'blsf';
  177.     kRootFolder                    = 'rotf';
  178.  
  179.  
  180. TYPE
  181.     FolderType                            = OSType;
  182.     FolderLocation                        = OSType;
  183.  
  184.     FolderDescPtr = ^FolderDesc;
  185.     FolderDesc = RECORD
  186.         descSize:                Size;
  187.         foldType:                FolderType;
  188.         flags:                    FolderDescFlags;
  189.         foldClass:                FolderClass;
  190.         foldLocation:            FolderType;
  191.         badgeSignature:            OSType;
  192.         badgeType:                OSType;
  193.         reserved:                UInt32;
  194.         name:                    StrFileName;                            {  Str63 on MacOS }
  195.     END;
  196.  
  197.  
  198.     RoutingFlags                        = UInt32;
  199.     FolderRoutingPtr = ^FolderRouting;
  200.     FolderRouting = RECORD
  201.         descSize:                Size;
  202.         fileType:                OSType;
  203.         routeFromFolder:        FolderType;
  204.         routeToFolder:            FolderType;
  205.         flags:                    RoutingFlags;
  206.     END;
  207.  
  208. { routing constants }
  209. {*************************}
  210. { Folder Manager routines }
  211. {*************************}
  212. { Folder Manager administration routines }
  213. FUNCTION AddFolderDescriptor(foldType: FolderType; flags: FolderDescFlags; foldClass: FolderClass; foldLocation: FolderLocation; badgeSignature: OSType; badgeType: OSType; name: ConstStrFileNameParam; replaceFlag: BOOLEAN): OSErr;
  214.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  215.     INLINE $7020, $A823;
  216.     {$ENDC}
  217. FUNCTION GetFolderDescriptor(foldType: FolderType; descSize: Size; VAR foldDesc: FolderDesc): OSErr;
  218.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  219.     INLINE $7023, $A823;
  220.     {$ENDC}
  221. FUNCTION GetFolderTypes(requestedTypeCount: UInt32; VAR totalTypeCount: UInt32; VAR theTypes: FolderType): OSErr;
  222.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  223.     INLINE $7024, $A823;
  224.     {$ENDC}
  225. FUNCTION RemoveFolderDescriptor(foldType: FolderType): OSErr;
  226.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  227.     INLINE $7021, $A823;
  228.     {$ENDC}
  229. { legacy routines }
  230. FUNCTION GetFolderName(vRefNum: INTEGER; foldType: OSType; VAR foundVRefNum: INTEGER; VAR name: StrFileName): OSErr;
  231.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  232.     INLINE $700E, $A823;
  233.     {$ENDC}
  234. { routing routines }
  235. FUNCTION AddFolderRouting(fileType: OSType; routeFromFolder: FolderType; routeToFolder: FolderType; flags: RoutingFlags; replaceFlag: BOOLEAN): OSErr;
  236.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  237.     INLINE $7026, $A823;
  238.     {$ENDC}
  239. FUNCTION RemoveFolderRouting(fileType: OSType; routeFromFolder: FolderType): OSErr;
  240.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  241.     INLINE $7027, $A823;
  242.     {$ENDC}
  243. FUNCTION FindFolderRouting(fileType: OSType; routeFromFolder: FolderType; VAR routeToFolder: FolderType; VAR flags: RoutingFlags): OSErr;
  244.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  245.     INLINE $7022, $A823;
  246.     {$ENDC}
  247. FUNCTION GetFolderRoutings(requestedRoutingCount: UInt32; VAR totalRoutingCount: UInt32; routingSize: Size; VAR theRoutings: FolderRouting): OSErr;
  248.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  249.     INLINE $701E, $A823;
  250.     {$ENDC}
  251. FUNCTION InvalidateFolderDescriptorCache(vRefNum: INTEGER; dirID: LONGINT): OSErr;
  252.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  253.     INLINE $7025, $A823;
  254.     {$ENDC}
  255. FUNCTION IdentifyFolder(vRefNum: INTEGER; dirID: LONGINT; VAR foldType: FolderType): OSErr;
  256.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  257.     INLINE $701F, $A823;
  258.     {$ENDC}
  259.  
  260.  
  261.  
  262.  
  263.  
  264. {$ALIGN RESET}
  265. {$POP}
  266.  
  267. {$SETC UsingIncludes := FoldersIncludes}
  268.  
  269. {$ENDC} {__FOLDERS__}
  270.  
  271. {$IFC NOT UsingIncludes}
  272.  END.
  273. {$ENDC}
  274.